package com.huaxiafinance.management.controller;

import com.huaxiafinance.management.mapper.YfqBankMapper;
import com.huaxiafinance.management.service.YfqMerchantService;
import com.huaxiafinance.management.util.MessageResult;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by wuyz on 2017/5/5.
 */
@Controller("yfqMerchantController")
@RequestMapping("/merchant")
@SuppressWarnings("SpringJavaAutowiringInspection")
public class YfqMerchantController {

    private static final Logger log = Logger.getLogger(YfqMerchantController.class);

    @Autowired
    private YfqMerchantService yfqMerchantService;

    @Autowired
    private YfqBankMapper yfqBankMapper;

    //全部城市下拉
    @RequestMapping(value = "/showCity", produces = "application/json; charset=utf-8")
    public @ResponseBody
    String selectSaleDep(String provinceId) throws Exception {
        MessageResult messageResult = new MessageResult();
        messageResult.setData(yfqMerchantService.showCity(provinceId));
        messageResult.setSuccessResult();
        return messageResult.getAsJSON();
    }
    //查出银行卡下拉
    @RequestMapping(value = "/queryBank", produces = "application/json; charset=utf-8")
    public @ResponseBody
    String queryBank() throws Exception {
        MessageResult messageResult = new MessageResult();
        messageResult.setData(yfqBankMapper.selectListBank());
        messageResult.setSuccessResult();
        return messageResult.getAsJSON();
    }
}
